{% extends "shop/base.html" %}

{% block title %}谢谢光临{% endblock %}

{% block content %}
    <h1>谢谢光临</h1>
    <p>订单已经生成，订单号是：<strong>{{ order.id }}</strong>.</p>

    <div class="order-info">
        <h3>订单详情</h3>
        <ul>
            {% for order_item in order.items.all %}
                <li>
                    {{ order_item.cart.quantity }}x {{ order_item.cart.item.name }}({{ order_item.cart.item.price }}) = ￥{{ order_item.cart.get_subtotal }}
                </li>
            {% endfor %}
        </ul>
        <p>总价：￥{{ order.get_total_price }}</p>
    </div>
    <div>
    <p>{{ order.name }} {{ order.address }}</p>
    </div>
    <div class="mt-6">
        <a href="#" class="py-4 px-8 font-semibold bg-red-500 hover:bg-red-700 text-white rounded-xl">取消订单</a>
        <a href="#" class="py-4 px-8 font-semibold bg-green-500 hover:bg-green-700 text-white rounded-xl">付款</a>
    </div>
{% endblock %}